package edu.zhang.front.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import edu.zhang.dao.CustomerDAO;
import edu.zhang.po.Customer;
import edu.zhang.po.Type;

@WebServlet("/customer/CustomerFormationOrder")
public class CustomerFormationOrder extends HttpServlet {
	private static final long serialVersionUID = 1L;
    private CustomerDAO customerDAO = new CustomerDAO();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String account = request.getParameter("account");
		Customer customer = customerDAO.getCustomerByAccount(account);

		HttpSession session = request.getSession();
		session.setAttribute("customer", customer);
		
		request.getRequestDispatcher("customer/CustomerOrder").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		this.doGet(request, response);
	}

}
